<template>
    <div class="ho-select" :class="{'selected': showOption}" ref="po-select">
        <input type="text" class="select-inner_input" @focus="focusHandler($event)" @blur="blurHandler" :placeholder="placeholder">
        <div class="select-inner-suffix">
            <div class="arrow-up">
                <svg-icon icon-class="arrow-up" className="arrow-up"></svg-icon>
            </div>
            <div class="arrow-down"></div>
        </div>
        <div class="options" v-show="showOption">
            <div class="option-item">AOPT超光子</div>
            <div class="option-item">ULTRAPULSE</div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'po-select',
    props: ['placeholder'],
    data () {
        return {
            showOption : false
        }
    },
    methods: {
        focusHandler () {
            this.showOption = true
        },
        blurHandler () {
            this.showOption = false
        }
    }
}
</script>
<style lang="css" scoped>
    .ho-select {
        display: inline-block;
        width:300px;
        text-align: center;
        position: relative;
        border: 1px solid #f0f0f0;
        color: #838383;
        border-radius: 5px;
    }
    .select-inner_input {
        width: 100%;
        line-height: 46px;
        border: none;
        box-shadow: 6px 6px 7px -3px rgb(178 178 178);
        box-sizing: border-box;
        text-indent: 10px;
        cursor: pointer;
        font-weight: 600;
    }
    .select-inner_input:focus {
        border: none;
        outline: 0;
    }
    .select-inner-suffix {
        display: inline-block;
        position:absolute;
        height: 100%;
        right: 10px;
        transition: transform 300ms ease-in-out;
    }
    .arrow-up {
        width: 20px;
        height: 100%;
    }
    .ho-select.selected .select-inner-suffix {
        transform: rotate(180deg);
    }
    .options {
        position: absolute;
        box-shadow: 3px 3px 18px 4px rgb(178 178 178);
        width: 100%;
        min-height: 100%;
        top: 100%;
        margin-top: 4px;
        border-radius: 5px;
        padding: 0 10px;
        text-align: left;
        z-index: 999;
        border: 1px solid #f0f0f0;
        background: #fff;
        letter-spacing: .5px;
    }
    .options .option-item {
        line-height: 40px;
    }
    .options .option-item:not(:last-child){
        border-bottom: 1px solid #999;
    }
    .option-item {
        /* font-size: 16px; */
        font-weight: 600;
    }
</style>